package com.hjy.scheduled.config.service;

import java.util.List;

public interface RedisReadWriteService {

    /**
     * @Title: get
     * @Description: 读取Redis值
     * @param prefix 后缀
     * @param key 健
     * @return T
     */
    <T> T get(String prefix, String key);

    /**
     * @Title: set
     * @Description: 写入Redis值
     * @param prefix 后缀
     * @param key 健
     * @param t 写入值
     * @return boolean
     */
    <T> boolean set(String prefix, String key, T t);

    /**
     * @Title: set
     * @Description: 写入Redis值
     * @param prefix 后缀
     * @param key 健
     * @param t 写入值
     * @param timeout 值失效时间
     * @return boolean
     */
    <T> boolean set(String prefix, String key, T t, Long timeout);

    /**
     * @Title: delete
     * @Description: 删除Redis值
     * @param prefix 后缀
     * @param key 健
     * @return boolean
     */
    <T> boolean delete(String prefix, String key);

    /**
     * @Title: getList
     * @Description: 读取Redis值-LIST
     * @param prefix 后缀
     * @param key 健
     * @return List<T>
     */
    <T> List<T> getList(String prefix, String key);

    /**
     * @Title: setList
     * @Description: 写入Redis值-LIST
     * @param prefix 后缀
     * @param key 健
     * @param t LIST
     * @return boolean
     */
    <T> boolean setList(String prefix, String key, List<T> t);

    /**
     * @Title: hashGet
     * @Description: 读取Redis值-HASH
     * @param realKey 外层大健
     * @param hashKey 内层小健
     * @return T
     */
    <T> T hashGet(String realKey, String hashKey);

    /**
     * @Title: hashSet
     * @Description: 写入Redis值-HASH
     * @param realKey 外层大健
     * @param hashKey 内层小健
     * @param t
     * @return boolean
     */
    <T> boolean hashSet(String realKey, String hashKey, T t);

    /**
     * @Title: hashDelete
     * @Description: 删除Redis值-HASH
     * @param realKey 外层大健
     * @return boolean
     */
    <T> boolean hashDelete(String realKey);

    /**
     * @Title: hashDelete
     * @Description: 删除Redis值-HASH
     * @param realKey 外层大健
     * @param hashKey 内层小健
     * @return boolean
     */
    <T> boolean hashDelete(String realKey, String hashKey);
}
